import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {path: '/', redirect: '/manager/home'},
        {
            path: '/manager',
            component: () => import('@/views/Manager.vue'),
            children: [
                {path: 'home', meta: {name: '系统首页'}, component: () => import('@/views/manager/Home.vue'),},
                {path: 'admin', meta: {name: '管理员信息'}, component: () => import('@/views/manager/Admin.vue'),},
                {path: 'notice', meta: {name: '系统公告'}, component: () => import('@/views/manager/Notice.vue'),},
                {path: 'person', meta: {name: '个人资料'}, component: () => import('@/views/manager/Person.vue'),},
                {path: 'password', meta: {name: '修改密码'}, component: () => import('@/views/manager/Password.vue'),},
                {path: 'banner', meta: {name: '首页海报'}, component: () => import('@/views/manager/Banner.vue'),},
                {path: 'category', meta: {name: '分类管理'}, component: () => import('@/views/manager/Category.vue'),},
                {path: 'goods', meta: {name: '壁纸信息'}, component: () => import('@/views/manager/Goods.vue'),},
                {path: 'user', meta: {name: '用户信息'}, component: () => import('@/views/manager/User.vue'),},
                {path: 'score', meta: {name: '壁纸评分'}, component: () => import('@/views/manager/Score.vue'),},
                {path: 'download', meta: {name: '壁纸下载'}, component: () => import('@/views/manager/Download.vue'),},
                {path: 'avatar', meta: {name: '头像精选'}, component: () => import('@/views/manager/Avatar.vue'),},
                {path: 'posts', meta: {name: '帖子信息'}, component: () => import('@/views/manager/Posts.vue'),},
                {path: 'comments', meta: {name: '评论信息'}, component: () => import('@/views/manager/Comments.vue'),},
            ]
        },

        {path: '/login', component: () => import('@/views/Login.vue')},
        {path: '/404', component: () => import('@/views/404.vue')},
        {path: '/:pathMatch(.*)', redirect: '/404'}
    ]
})

export default router
